package com.dragon.modules.yuegou.query.marketing;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.marketing.HomeActivityEntity;
import com.dragon.modules.yuegou.enums.marketing.HomeActivityActivityChannel;
import com.dragon.modules.yuegou.enums.marketing.HomeActivityActivityType;
import com.dragon.modules.yuegou.enums.marketing.HomeActivityStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 首页弹框活动表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-08-29 09:51:57
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class HomeActivityQuery extends HomeActivityEntity implements Query<HomeActivityEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "activityName")
	private Condition<String> activityNameCondition;

    /** [枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件 */
	@JsonUnwrapped(prefix = "activityType")
	private Condition<HomeActivityActivityType> activityTypeCondition;

    /** [枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<HomeActivityStatus> statusCondition;

    /** 开始时间查询条件 */
	@JsonUnwrapped(prefix = "startTime")
	private Condition<LocalDateTime> startTimeCondition;

    /** 结束时间查询条件 */
	@JsonUnwrapped(prefix = "endTime")
	private Condition<LocalDateTime> endTimeCondition;

    /** 禁用时间查询条件 */
	@JsonUnwrapped(prefix = "forbidTime")
	private Condition<LocalDateTime> forbidTimeCondition;

    /** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 更新人ID查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "timeInterval")
	private Condition<Integer> timeIntervalCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "img")
	private Condition<String> imgCondition;

    /** 链接地址查询条件 */
	@JsonUnwrapped(prefix = "url")
	private Condition<String> urlCondition;

    /** 商品spuId查询条件 */
	@JsonUnwrapped(prefix = "spuId")
	private Condition<String> spuIdCondition;

    /** [枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件 */
	@JsonUnwrapped(prefix = "activityChannel")
	private Condition<HomeActivityActivityChannel> activityChannelCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public HomeActivityQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public HomeActivityQuery(HomeActivityEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public HomeActivityQuery(HomeActivityQuery other) {
		super(other);
		if (other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if (other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if (other.activityNameCondition != null) {
			this.activityNameCondition = other.activityNameCondition.copy();
		}
		if (other.activityTypeCondition != null) {
			this.activityTypeCondition = other.activityTypeCondition.copy();
		}
		if (other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if (other.startTimeCondition != null) {
			this.startTimeCondition = other.startTimeCondition.copy();
		}
		if (other.endTimeCondition != null) {
			this.endTimeCondition = other.endTimeCondition.copy();
		}
		if (other.forbidTimeCondition != null) {
			this.forbidTimeCondition = other.forbidTimeCondition.copy();
		}
		if (other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if (other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if (other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if (other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if (other.timeIntervalCondition != null) {
			this.timeIntervalCondition = other.timeIntervalCondition.copy();
		}
		if (other.imgCondition != null) {
			this.imgCondition = other.imgCondition.copy();
		}
		this.setOther(other);
	}
	private void setOther(HomeActivityQuery other){
		if(other.urlCondition != null) {
			this.urlCondition = other.urlCondition.copy();
		}
		if(other.spuIdCondition != null) {
			this.spuIdCondition = other.spuIdCondition.copy();
		}
		if(other.activityChannelCondition != null) {
			this.activityChannelCondition = other.activityChannelCondition.copy();
		}
	}

	@Override
	public QueryWrapper<HomeActivityEntity> toQueryWrapper() {
		QueryWrapper<HomeActivityEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (activityNameCondition != null) {
			activityNameCondition.toWrapper(wrapper, COL_ACTIVITY_NAME);
		}
		if (activityTypeCondition != null) {
			activityTypeCondition.toWrapper(wrapper, COL_ACTIVITY_TYPE);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (startTimeCondition != null) {
			startTimeCondition.toWrapper(wrapper, COL_START_TIME);
		}
		if (endTimeCondition != null) {
			endTimeCondition.toWrapper(wrapper, COL_END_TIME);
		}
		if (forbidTimeCondition != null) {
			forbidTimeCondition.toWrapper(wrapper, COL_FORBID_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (timeIntervalCondition != null) {
			timeIntervalCondition.toWrapper(wrapper, COL_TIME_INTERVAL);
		}
		if (imgCondition != null) {
			imgCondition.toWrapper(wrapper, COL_IMG);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<HomeActivityEntity> getQueryWrapper(QueryWrapper<HomeActivityEntity> wrapper){
		if (urlCondition != null) {
			urlCondition.toWrapper(wrapper, COL_URL);
		}
		if (spuIdCondition != null) {
			spuIdCondition.toWrapper(wrapper, COL_SPU_ID);
		}
		if (activityChannelCondition != null) {
			activityChannelCondition.toWrapper(wrapper, COL_ACTIVITY_CHANNEL);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return busdIdCondition 查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return busdIdCondition 查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param busdIdCondition 查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return activityNameCondition 查询条件
	 */
	public Condition<String> activityName() {
		this.activityNameCondition = new Condition<>();
		return this.activityNameCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return activityNameCondition 查询条件
	 */
	public Condition<String> getActivityNameCondition() {
		return activityNameCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param activityNameCondition 查询条件
	 */
	public void setActivityNameCondition(Condition<String> activityNameCondition) {
		this.activityNameCondition = activityNameCondition;
	}

	/**
	 * 构造并返回[枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 * 
	 * @return activityTypeCondition [枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 */
	public Condition<HomeActivityActivityType> activityType() {
		this.activityTypeCondition = new Condition<>();
		return this.activityTypeCondition;
	}
	
	/**
	 * 获取[枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 * 
	 * @return activityTypeCondition [枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 */
	public Condition<HomeActivityActivityType> getActivityTypeCondition() {
		return activityTypeCondition;
	}

	/**
	 * 设置[枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 * 
	 * @param activityTypeCondition [枚举]活动类型：0-商品推荐-PRODUCT、1-专题活动-ACTIVITY查询条件
	 */
	public void setActivityTypeCondition(Condition<HomeActivityActivityType> activityTypeCondition) {
		this.activityTypeCondition = activityTypeCondition;
	}

	/**
	 * 构造并返回[枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 */
	public Condition<HomeActivityStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 */
	public Condition<HomeActivityStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 * 
	 * @param statusCondition [枚举]状态：0-待开始-WAITING、1-进行中-DOING、2-禁用-FORBIDDEN、3-已过期-EXPIRED查询条件
	 */
	public void setStatusCondition(Condition<HomeActivityStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回开始时间查询条件
	 * 
	 * @return startTimeCondition 开始时间查询条件
	 */
	public Condition<LocalDateTime> startTime() {
		this.startTimeCondition = new Condition<>();
		return this.startTimeCondition;
	}
	
	/**
	 * 获取开始时间查询条件
	 * 
	 * @return startTimeCondition 开始时间查询条件
	 */
	public Condition<LocalDateTime> getStartTimeCondition() {
		return startTimeCondition;
	}

	/**
	 * 设置开始时间查询条件
	 * 
	 * @param startTimeCondition 开始时间查询条件
	 */
	public void setStartTimeCondition(Condition<LocalDateTime> startTimeCondition) {
		this.startTimeCondition = startTimeCondition;
	}

	/**
	 * 构造并返回结束时间查询条件
	 * 
	 * @return endTimeCondition 结束时间查询条件
	 */
	public Condition<LocalDateTime> endTime() {
		this.endTimeCondition = new Condition<>();
		return this.endTimeCondition;
	}
	
	/**
	 * 获取结束时间查询条件
	 * 
	 * @return endTimeCondition 结束时间查询条件
	 */
	public Condition<LocalDateTime> getEndTimeCondition() {
		return endTimeCondition;
	}

	/**
	 * 设置结束时间查询条件
	 * 
	 * @param endTimeCondition 结束时间查询条件
	 */
	public void setEndTimeCondition(Condition<LocalDateTime> endTimeCondition) {
		this.endTimeCondition = endTimeCondition;
	}

	/**
	 * 构造并返回禁用时间查询条件
	 * 
	 * @return forbidTimeCondition 禁用时间查询条件
	 */
	public Condition<LocalDateTime> forbidTime() {
		this.forbidTimeCondition = new Condition<>();
		return this.forbidTimeCondition;
	}
	
	/**
	 * 获取禁用时间查询条件
	 * 
	 * @return forbidTimeCondition 禁用时间查询条件
	 */
	public Condition<LocalDateTime> getForbidTimeCondition() {
		return forbidTimeCondition;
	}

	/**
	 * 设置禁用时间查询条件
	 * 
	 * @param forbidTimeCondition 禁用时间查询条件
	 */
	public void setForbidTimeCondition(Condition<LocalDateTime> forbidTimeCondition) {
		this.forbidTimeCondition = forbidTimeCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 * 
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置更新人ID查询条件
	 * 
	 * @param modifiedByCondition 更新人ID查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return timeIntervalCondition 查询条件
	 */
	public Condition<Integer> timeInterval() {
		this.timeIntervalCondition = new Condition<>();
		return this.timeIntervalCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return timeIntervalCondition 查询条件
	 */
	public Condition<Integer> getTimeIntervalCondition() {
		return timeIntervalCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param timeIntervalCondition 查询条件
	 */
	public void setTimeIntervalCondition(Condition<Integer> timeIntervalCondition) {
		this.timeIntervalCondition = timeIntervalCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return imgCondition 查询条件
	 */
	public Condition<String> img() {
		this.imgCondition = new Condition<>();
		return this.imgCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return imgCondition 查询条件
	 */
	public Condition<String> getImgCondition() {
		return imgCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param imgCondition 查询条件
	 */
	public void setImgCondition(Condition<String> imgCondition) {
		this.imgCondition = imgCondition;
	}

	/**
	 * 构造并返回链接地址查询条件
	 * 
	 * @return urlCondition 链接地址查询条件
	 */
	public Condition<String> url() {
		this.urlCondition = new Condition<>();
		return this.urlCondition;
	}
	
	/**
	 * 获取链接地址查询条件
	 * 
	 * @return urlCondition 链接地址查询条件
	 */
	public Condition<String> getUrlCondition() {
		return urlCondition;
	}

	/**
	 * 设置链接地址查询条件
	 * 
	 * @param urlCondition 链接地址查询条件
	 */
	public void setUrlCondition(Condition<String> urlCondition) {
		this.urlCondition = urlCondition;
	}

	/**
	 * 构造并返回商品spuId查询条件
	 * 
	 * @return spuIdCondition 商品spuId查询条件
	 */
	public Condition<String> spuId() {
		this.spuIdCondition = new Condition<>();
		return this.spuIdCondition;
	}
	
	/**
	 * 获取商品spuId查询条件
	 * 
	 * @return spuIdCondition 商品spuId查询条件
	 */
	public Condition<String> getSpuIdCondition() {
		return spuIdCondition;
	}

	/**
	 * 设置商品spuId查询条件
	 * 
	 * @param spuIdCondition 商品spuId查询条件
	 */
	public void setSpuIdCondition(Condition<String> spuIdCondition) {
		this.spuIdCondition = spuIdCondition;
	}

	/**
	 * 构造并返回[枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 * 
	 * @return activityChannelCondition [枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 */
	public Condition<HomeActivityActivityChannel> activityChannel() {
		this.activityChannelCondition = new Condition<>();
		return this.activityChannelCondition;
	}
	
	/**
	 * 获取[枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 * 
	 * @return activityChannelCondition [枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 */
	public Condition<HomeActivityActivityChannel> getActivityChannelCondition() {
		return activityChannelCondition;
	}

	/**
	 * 设置[枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 * 
	 * @param activityChannelCondition [枚举]活动渠道：0-全部-ALL、1-小程序-MINIAPP、2-APP-APP查询条件
	 */
	public void setActivityChannelCondition(Condition<HomeActivityActivityChannel> activityChannelCondition) {
		this.activityChannelCondition = activityChannelCondition;
	}

}
